package com.qf.util;

import org.springframework.util.DigestUtils;

import java.util.UUID;

public class StringUtil {

    /**
     * 判断当前字符串是否为空
     * @param str
     * @return true:为空; false:不为空
     */
    public static boolean isEmpty(String str) {

        return null == str || "".equals(str);

    }

    /**
     * 对字符串进行MD5加密
     * @param origin
     * @return
     */
    public static String MD5Encode(String origin){

        return DigestUtils.md5DigestAsHex(origin.getBytes());
    }
    public static String getUUID(){
        return UUID.randomUUID().toString().replaceAll("-","");
    }


}
